<?php

namespace app\model;
use app\utils\TaskOrderEmun;
use think\model\concern\SoftDelete;
class TaskOrder extends BaseModel
{
    use SoftDelete;
    protected $table = 'task_order';

    //protected $json = ['imgs'];

    protected $deleteTime = 'delete_at';
    // 关联任务表
    public function task(){
        return $this->belongsTo(Task::class,'task_id','id');
    }

    // 关联会员表
    public function member(){
        return $this->belongsTo(Member::class, 'member_id', 'id');
    }

    public function getStatusTextAttr($value, $data)
    {
        return TaskOrderEmun::taskOrderStatusText($data['status']);
    }

    public function getAuditTimeAttr($value, $data)
    {
        return isValidDate($value)?$value:'';
    }



}
